package thulearningcore;

import java.util.ArrayList;
import thulearningcore.util.*;

public class ConnectionExceptionManager {
	protected ArrayList<TLExceptionListener> listeners;
	public ConnectionExceptionManager(){
		listeners = new	ArrayList<TLExceptionListener>();
	}
	public void addListener(TLExceptionListener listener) {
		if(!listeners.contains(listener))
			listeners.add(listener);
	}
	public void removeListener(TLExceptionListener listener) {
		listeners.remove(listener);
	}
	public void clearAllListeners() {
		listeners.clear();
	}
	public void performEvent(TLExceptionEvent e) {
		for (TLExceptionListener l : listeners){
			l.actionPerformed(e);
		}
	}
}

